<?php
	namespace Application\Home\Controller;
	use Application\Home\Model\Product as ProductModel;
	use Application\Home\Model\Procat;
	class Product{
		public function index(){
			
//			产品端口：
//			仿古瓷id=1;
//			现代瓷id=2;
//			家用瓷id=2;
			
//			$id = $_POST['id'];
			
			$cat = new procat();
			
			$procat = $cat->order('id asc')->select();

			$id = $procat[0]['id'];

			$product = new ProductModel();

			$data = $product->where("pro_class=$id")->field('pro_src,pro_name')->order('id asc')->select();

			$json = json_encode($data);

			echo $json;
		}
		
			public function xiandaici(){
				
			$cat = new procat();
			
			$procat = $cat->order('id asc')->select();

			$id = $procat[1]['id'];
			
			$product = new ProductModel();

			$data = $product->where("pro_class=$id")->field('pro_src,pro_name')->order('id asc')->select();

			$json = json_encode($data);
			
			echo $json;
		}	
		
		public function jiayongci(){
			
			$cat = new procat();
			
			$procat = $cat->order('id asc')->select();

			$id = $procat[2]['id'];
			
			$product = new ProductModel();

			$data = $product->where("pro_class=$id")->field('pro_src,pro_name')->order('id asc')->select();
			
			$json = json_encode($data);
			
			echo $json;
		}
		
	}
?>